package com.charging.controller.user;


import com.charging.entity.User;
import com.charging.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/user/center")
public class PersonCenterController {

    @Autowired
    private UserService userService;

    @GetMapping("/personCenter/{id}")
    public String personDetail (@PathVariable Long id,Model model){
        User user = userService.getUserById(id);
        model.addAttribute("user",user);
        return "user/center/personCenter";
    }
}
